import request from '@/utils/http'
import type { dateList, detailQueryParams } from './healthDiaryModel'

// 获取一周数据
export const getWeekList = (params: dateList) => {
  return request.get({
    url: '/api/heppatientdiary/date-list',
    data: params
  })
}

// 获取日记数据
export const getDiaryList = (params: detailQueryParams) => {
  return request.get({
    url: '/api/heppatientdiary/detail',
    data: params
  })
}

// 保存减重日记
export const saveDiary = (params: any) => {
  return request.post({
    url: '/api/heppatientdiary/save',
    data: params
  })
}

// 图片上传
export const uploadImage = (file: any) => {
  return request.upload({
    url: '/api/heppatientdiary/upload',
    file: file,
    name: 'imgFile'
  })
}
